package com.piggy.logi.sys.controller;

import com.piggy.common.core.domain.R;
import com.piggy.common.core.web.controller.BaseController;
import com.piggy.common.core.web.page.TableDataInfo;
import com.piggy.common.log.annotation.Log;
import com.piggy.common.log.enums.BusinessType;
import com.piggy.logi.sys.bo.LogiWaybillKefuLogEditBo;
import com.piggy.logi.sys.bo.LogiWaybillKefuLogQueryBo;
import com.piggy.logi.sys.service.ILogiWaybillKefuLogService;
import com.piggy.logi.sys.vo.LogiWaybillKefuLogVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 运单客服日志信息Controller
 *
 * @author piggy
 * @date 2023-10-25
 */
@Api(value = "运单客服日志信息控制器", tags = {"运单客服日志信息管理"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/sys/log/kefu")
public class LogiWaybillKefuLogController extends BaseController {

    private final ILogiWaybillKefuLogService iLogiWaybillKefuLogService;

    /**
     * 查询运单客服日志信息列表
     */
    @ApiOperation("查询运单客服日志信息列表")
    //@SaCheckPermission("sys:log:list")
    @GetMapping("/list")
    public TableDataInfo<LogiWaybillKefuLogVo> list(@Validated LogiWaybillKefuLogQueryBo bo) {
        return iLogiWaybillKefuLogService.queryPageList(bo);
    }

    /**
     * 导出运单客服日志信息列表
     *//*
    @ApiOperation("导出运单客服日志信息列表")
    //@SaCheckPermission("sys:log:export")
    @Log(title = "运单客服日志信息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public void export(@Validated LogiWaybillKefuLogQueryBo bo, HttpServletResponse response) throws IOException {
        List<LogiWaybillKefuLogVo> list = iLogiWaybillKefuLogService.queryList(bo);
        ExcelUtil<LogiWaybillKefuLogVo> util = new ExcelUtil<LogiWaybillKefuLogVo>(LogiWaybillKefuLogVo.class);
        util.exportExcel(response, list, "运单客服日志信息");
    }*/

    /**
     * 获取运单客服日志信息详细信息
     *//*
    @ApiOperation("获取运单客服日志信息详细信息")
    //@SaCheckPermission("sys:log:query")
    @GetMapping("/{id}")
    public R<LogiWaybillKefuLogVo> getInfo(@NotNull(message = "主键不能为空")
                                                  @PathVariable("id") Long id) {
        return R.ok(iLogiWaybillKefuLogService.queryById(id));
    }*/

    /**
     * 新增运单客服日志信息
     */
    @ApiOperation("新增运单客服日志信息")
    //@SaCheckPermission("sys:log:add")
    @Log(title = "运单客服日志信息", businessType = BusinessType.INSERT)
    @PostMapping()
    public R<LogiWaybillKefuLogVo> add(@Validated @RequestBody LogiWaybillKefuLogEditBo bo) {
        return R.ok(iLogiWaybillKefuLogService.insertByAddBo(bo));
    }

    /**
     * 修改运单客服日志信息
     */
    @ApiOperation("修改运单客服日志信息")
    //@SaCheckPermission("sys:log:edit")
    @Log(title = "运单客服日志信息", businessType = BusinessType.UPDATE)
    @PutMapping()
    public R<LogiWaybillKefuLogVo> edit(@Validated @RequestBody LogiWaybillKefuLogEditBo bo) {
        return R.ok(iLogiWaybillKefuLogService.updateByEditBo(bo));
    }

    /**
     * 删除运单客服日志信息
     *//*
    @ApiOperation("删除运单客服日志信息")
    //@SaCheckPermission("sys:log:remove")
    @Log(title = "运单客服日志信息" , businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public R<Integer> remove(@NotEmpty(message = "主键不能为空")
                                       @PathVariable Long[] ids) {
        return R.ok(iLogiWaybillKefuLogService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
    }*/
}
